#include <stdio.h>
#include<math.h>
//判断是否是素数的函数
int judge(int a)
{
  int i;
  int flag=0;
  for(i=2;i<=sqrt(a);i++)
   {
      if(a%i == 0)
       { flag = 1;
         break;
       }
       else flag = 0;

   }
   return flag;
}
int main(void)
{
  int n,i,count=0;
  scanf("%d",&n);
  for(i=2;i<=n;i++)
  {
    if(judge(i) == 0)
    {
      printf("%5d\n",i);
      count++;
    }
  }
  printf("%d",count);
}
